<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增（报价单）')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-add">
        	<input name="customerId" type="hidden" id="customerId" />
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">报价客户：</label>
                <div class="col-sm-8">
                	<div class="input-group">
	                    <input name="customerName" onclick="selectCustomer()" class="form-control" type="text" placeholder="请选择报价客户 " id="customerName" required readonly>
	                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">主题：</label>
                <div class="col-sm-8">
                    <input name="orderName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">报价总额：</label>
                <div class="col-sm-8">
                    <input name="totalPrice" class="form-control" type="text" placeholder="保存后添加产品自动计算" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">报价时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="prcieDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>            
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">报价有效截止时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="prcieEndDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">报价人：</label>
                <div class="col-sm-8">
                    <input name="prcieBy" class="form-control" type="text">
                </div>
            </div>            
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "crm/orderPrice"
        $("#form-order-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-order-add').serialize());
            }
        }

        $("input[name='prcieDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        $("input[name='prcieEndDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        /* 订单管理-修改-选择客户  */
	    function selectCustomer() {
	    	var url = ctx + "crm/customer/selectCustomer";
	   		$.modal.open("选择客户", url);
		}
    </script>
</body>
</html>